import request from '@/utils/request'

// 查询充电电站列表
export function listStation(query) {
  return request({
    url: '/equipment/station/list',
    method: 'get',
    params: query
  })
}

// 查询充电电站详细
export function getStation(id) {
  return request({
    url: '/equipment/station/' + id,
    method: 'get'
  })
}

// 查询充电电站列表
export function searchStation(query) {
  return request({
    url: '/equipment/station/conditions',
    method: 'get',
    params: query
  })
}

// 新增充电电站
export function addStation(data) {
  return request({
    url: '/equipment/station',
    method: 'post',
    data: data
  })
}

// 修改充电电站
export function updateStation(data) {
  return request({
    url: '/equipment/station',
    method: 'put',
    data: data
  })
}

// 删除充电电站
export function delStation(data) {
  return request({
    url: '/equipment/station',
    method: 'delete',
    data: data
  })
}

// 获取省市区
export function listPCA() {
  return request({
    url: '/region/treeList',
    method: 'get'
  })
}

// 充电电站绑定电桩
export function bindDev(id, data) {
  return request({
    url: '/equipment/station/bind/' + id,
    method: 'put',
    data: data
  })
}

// 充电电站解绑电桩
export function unbindDev(data) {
  return request({
    url: '/equipment/station/unbind',
    method: 'put',
    data: data
  })
}
